#include "utils.h"

QString utils::fieldToChinese(const QString &field) {
    static const QMap<QString, QString> fieldMap = {
        {QStringLiteral("province"), QStringLiteral("省份")},
        {QStringLiteral("city"), QStringLiteral("城市")},
        {QStringLiteral("adcode"), QStringLiteral("区县编码")},
        {QStringLiteral("weather"), QStringLiteral("天气")},
        {QStringLiteral("temperature"), QStringLiteral("温度")},
        {QStringLiteral("temperature_float"), QStringLiteral("浮点温度")},
        {QStringLiteral("winddirection"), QStringLiteral("风向")},
        {QStringLiteral("windpower"), QStringLiteral("风力")},
        {QStringLiteral("humidity"), QStringLiteral("湿度")},
        {QStringLiteral("humidity_float"), QStringLiteral("浮点湿度")},
        {QStringLiteral("reporttime"), QStringLiteral("报告时间")}
    };
    return fieldMap.value(field, field);
}
